<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title th:replace="~{commons/admincommon::title}">index</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div th:replace="~{commons/admincommon::header}"></div>
    <div th:replace="~{commons/admincommon::sidebar(active='articleInfos.html')}"></div>

    <div class="layui-body">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>博文管理</legend>
        </fieldset>
        <table class="layui-table">
            <tr>
                <th>编号</th>
                <th>文章标题</th>
                <th>简介</th>
                <th>文件名称</th>
                <th>是否置顶</th>
                <th>访问量</th>
                <th>创建时间</th>
                <th>上一次修改时间</th>
                <th>
                    <a class="layui-btn layui-btn-checked" th:href="@{/article/add}">新增</a>
                </th>
            </tr>
            <br>
            <tr th:each="articleInfo:${articleInfos}">
                <td th:text="${articleInfo.getId()}">id</td>
                <td th:text="${articleInfo.getTitle()}">title</td>
                <td th:text="${articleInfo.getSummary()}">summary</td>
                <td th:text="${articleInfo.getFilename()}">filename</td>
                <td th:text="${articleInfo.getIsTop()==1?'是':'否'}">is_top</td>
                <td th:text="${articleInfo.getTraffic()}">traffic</td>
                <td th:text="${#dates.format(articleInfo.getCreateBy(), 'yyyy-MM-dd HH:mm:ss')}">create_by</td>
                <td th:text="${#dates.format(articleInfo.getModifiedBy(), 'yyyy-MM-dd HH:mm:ss')}">modified_by</td>
                <td>
                    <a class="layui-btn" th:href="@{/article/update/} + ${articleInfo.getId()}">编辑</a>
                    <a class="layui-btn layui-btn-danger" th:href="@{/article/} + ${articleInfo.getId()}">删除</a>
                </td>
            </tr>

        </table>
    </div>
    <div th:replace="~{commons/admincommon::footer}"></div>
</div>
<script th:src="@{/layui/layui.js}"></script>
<script>
    layui.use(['element'], function () {
        var element = layui.element;
    });
</script>
</table>
</body>
</html>